package spring.board.dao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;

import spring.board.vo.Board;
import spring.board.vo.Comments;
import spring.board.vo.FriendlistVO;
import spring.board.vo.MemberInfo;

public  class MainDaoImpl extends SqlSessionDaoSupport implements MainDao {
	
	
	
	@Override
	public int registMember(MemberInfo memberInfo) {
		return getSqlSession().insert("main.registMember", memberInfo);
	}
	@Override
	public int registFriend(String username){
		return getSqlSession().insert("main.registFriend", username);
	}

	@Override
	public int writeComment(Comments comments) {
		return getSqlSession().insert("main.writeComment",comments);
	}
	
	@Override
	public List getList(Map<String, Object> paramMap) {
		return getSqlSession().selectList("main.getList");
	}
	
	@Override
	public String getPassword(String username) {
		return (String)getSqlSession().selectOne("main.getPassword",username);
	}
	
	@Override
	public List<FriendlistVO> searchFriend(String username) {
		return (List)getSqlSession().selectList("main.searchFriendlist", username);
	}
	
	@Override
	public List<Comments> getComments(String num) {
		return (List)getSqlSession().selectList("main.getComments", num);
	}
}


